Developer Documentation
PATH  WebObjects 4.0 Documentation > WebObjects Tools and Techniques

Table of Contents Previous Section

Creating Variables and Methods in WebObjects Builder

At the bottom of the object browser, there is a pull-down menu called Edit sourcefile. It has three items:

When you choose Add Variable/Method, the following panel opens:

In this panel, you specify:

When you click Add, the key's name appears in the object browser (below application and session). To see what was added to your source code, choose View Source File from the pop-up menu in the object browser. You'll see something like the following:

When you choose Add Action, the following panel appears:

When you click Add, the following code is added to your source file:

public ThatPage myAction()
{
ThatPage nextPage = (ThatPage)pageWithName("ThatPage");

// Initialize your component here

return nextPage;
}
WebObjects Builder provides these ways to add variables and methods for your convenience. Of course, you can add variables and methods directly to your component's code by editing them in Project Builder.

The Add Variable/Method and Add Action menu items apply to the code file that appears in the menu's title, as in "Edit Main.java.". To add variables and methods to the application or session code files, select application or session in the object browser first. Notice that the pull-down menu title changes accordingly. Then choose Add Variable/Method or Add Action from the pull-down menu. Deselect the keys in the object browser to return to the main component (On Mac OS X Server, command-click to deselect, and on Windows NT control-click).

To delete a key or action, you must delete it from the source code in Project Builder.

Table of Contents Next Section